<template>
  <div>
    <Tabs :text="text">
      <Search @data="upState" />
    </Tabs>
    <StaffSearchItem v-if="state" />
    <router-view></router-view>
    <Paging />
    <div></div>
  </div>
</template>

<script>
import Tabs from "../components/Tabs.vue";
import Search from "../components/Search.vue";
import Paging from "../components/Paging.vue";
import StaffSearchItem from "../components/StaffSearchItem.vue";
import {
  // addressBookAxios,
  // addressBookAxios2,
  searchAxios
} from "../http/apis/AdressBookApi";

export default {
  components: {
    Tabs,
    Search,
    Paging,
    StaffSearchItem,
  },
  data() {
    return {
     

      text: [
        {
          id: "1",
          textName: "通讯列表",
          url: "/addressbook/phonelist",
        },
        {
          id: "2",
          textName: "总经办",
          url: "/addressbook/generalmanager",
        },
        {
          id: "3",
          textName: "财务部",
          url: "/addressbook/financedept",
        },
        {
          id: "4",
          textName: "业务一部",
          url: "/addressbook/businessone",
        },
        {
          id: "5",
          textName: "业务二部",
          url: "/addressbook/businesstwo",
        },
        {
          id: "6",
          textName: "渠道招商部",
          url: "/addressbook/channeldep",
        },
        {
          id: "7",
          textName: "营销部",
          url: "/addressbook/businesstwo",
        },
        {
          id: "8",
          textName: "采购部",
          url: "/addressbook/purchasingdep",
        },
        {
          id: "9",
          textName: "客服部",
          url: "/addressbook/customerserver",
        },
        {
          id: "10",
          textName: "已离职列表",
          url: "/addressbook/leavelist",
        },
      ],
      state: false,
    };
  },
  created() {
    // addressBookAxios()
    //   .then((res) => {
    //     console.log("陈仪", res);
    //   })
    //   .catch((err) => {
    //     console.log("陈仪错误", err);
    //   });
    // addressBookAxios2()
    //   .then((res) => {
    //     console.log("陈仪2", res);
    //   })
    //   .catch((err) => {
    //     console.log("陈仪错误2", err);
    //   });
    searchAxios()
      .then((res) => {
        console.log("内部通讯搜索请求成功", res.data);
      })
      .catch((err) => {
        console.log("内部通讯搜索请求失败", err);
      });
      
  },
  methods: {
    upState(data) {
      this.state = !data; //状态处理
    },
  },
};
</script>

<style>
</style>